<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>查询审批状态信息</title>
<link rel="stylesheet" 
	href=${pageContext.servletContext.contextPath}/js/bootstrap.min.css>
	
<link rel="stylesheet" type="text/css" href=${pageContext.servletContext.contextPath}/themes/default/easyui.css>   
<link rel="stylesheet" type="text/css" href=${pageContext.servletContext.contextPath}/themes/icon.css> 
<link rel="stylesheet" type="text/css" href=${pageContext.servletContext.contextPath}/themes/bootstrap/easyui.css>  
<script type="text/javascript" src=${pageContext.servletContext.contextPath}/js/jquery.min.js></script>   
<script type="text/javascript" src=${pageContext.servletContext.contextPath}/js/jquery.easyui.min.js></script> 
<script type="text/javascript" src=${pageContext.servletContext.contextPath}/js/easyui-lang-zh_CN.js></script>
<script type="text/javascript"
	src=${pageContext.servletContext.contextPath}/js/bootstrap.min.js></script>
</head>
<script>
$(function(){
	//搜索窗口
	$('#search').dialog('close');
	
	//所有诉求数据表格
	$('#dg').datagrid({   
	
	    url:'${pageContext.servletContext.contextPath}/queryChecks', 
	    queryParams: {
			uid: '${sessionScope.uid}',
		},

	    columns:[[    
	        {field:'rid',title:'诉求id',width:100},    
	        {field:'oid',title:'菜单id号',width:100},
	        {field:'r_rid',title:'点菜员',width:100},
	        {field:'fname',title:'菜品名',width:100},    
	        {field:'rcontent',title:'诉求内容',width:100},    
	        {field:'rcount',title:'诉求数量',width:100},
	        {field:'rstate',title:'审批状态',width:100},    
	        {field:'uname',title:'审批人',width:100},
	        {field:'rtime',title:'审批时间',width:180},    
	    ]],
	    toolbar: [{
	    	iconCls: 'icon-back',
			text:'返回',
			width:100,
			handler: function(){
				$('#dg').datagrid('reload');
			}
		},'-',{
			iconCls: 'icon-search',
			text:'搜索查询',
			width:100,
			handler: function(){
				$('#search').dialog('open');
			}
		}],
	    striped:true,
	    pagination:true,
	    pageSize:5,
		pageList:[5,10,15,20],
	}); 
	$('#sf').click(function(){
		var fname = $("#fname").val();
		$('#search').dialog('close');
		$("#fname").val("");
		
		$.ajax({
			url : "${pageContext.servletContext.contextPath}/sChecksByFnameUidM",
			dataType : "json",
			async : true,
			data : {
				"fname" : fname,
				"uid":'${sessionScope.uid}'
			},
			type : "post",
			success : function(r) {
				$.each(r,function(i,n){
					$("#dg").datagrid("loadData",{ rows : n });			
				})
			}
		});
		
	})

})
</script>
<body>
<table id="dg"></table>

<div id="search" class="easyui-dialog" title="搜索" style="width:300px;height:200px;"   
        data-options="iconCls:'icon-save',resizable:true,modal:true">       
		<div class="input-group">
			<span class="input-group-addon">菜名:</span>
			<input id="fname" type="text"
				class="form-control"/>	 
		</div>	
		<div>
			<a id="sf" class="easyui-linkbutton" iconCls="icon-search"
					style="width: 100%; height: 32px">搜一搜</a> 
		</div>
	</div>  
<body>

</body>
</html>